<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" pageEncoding="utf8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<title>添加商品</title>
		<link rel="stylesheet" href="<c:url value="/css/adminsinglepage.css"/>" type="text/css" />
		<link rel="stylesheet" href="<c:url value='/scripts/themes/base/jquery.ui.all.css'/>" type="text/css" />
	</head>
	<body class="single-page single-page-col2">

		<div id="single-page-tbar">
			<h1>
				<img src="<c:url value="/images/transparent.gif"/>" class="imgbundle" style="width: 16px; height: 16px; background-position: 0pt -2235px;">
					<strong>正在查看:</strong>订单 - ${orders.orderId} 
			</h1>
			<div class="action-bar action-bar-order">
				<div class="order-ctls">
					<span class="action-bar-info">订单状态操作:</span>
					<!--<input type="button" onclick="OrderMgr.act.confirm(this)" value="确认" />-->
					<span class="action-bar-btns"><span>
							<ul>
								<li class="first">
									<input value="支付..." <c:if test="${!orders.showPayButton}">disabled="disabled" class="inactive" </c:if> onclick="location.href='od_payment_add.html?orderId=${orders.orderId}'" type="button" />
								</li>
								<li>
									<input value="发货..." <c:if test="${!orders.showShipButton}">disabled="disabled" class="inactive" </c:if> onclick="location.href='od_ship_add.html?orderId=${orders.orderId}'" type="button">
								</li>
								<li>
									<input value="完成" <c:if test="${!orders.showFinishButton}">disabled="disabled" class="inactive" </c:if>
										onclick="location.href='od_order_update.html?orders.orderId=${orders.orderId}&orders.status=3'" type="button">
								</li>
							</ul> </span> </span>
					<span class="action-bar-btns"><span>
							<ul>
								<li class="first">
									<input value="退款..." <c:if test="${!orders.showRefundButton}">disabled="disabled" class="inactive"</c:if> onclick="location.href='od_refund_add.html?orderId=${orders.orderId}'" type="button">
								</li>
								<li>
									<input value="退货..." <c:if test="${!orders.showReshipButton}">disabled="disabled" class="inactive"</c:if> onclick="location.href='od_reship_add.html?orderId=${orders.orderId}'" type="button">
								</li>
							</ul> </span> </span>
					<span class="action-bar-btns"><span>
							<ul>
								<li class="first">
									<input value="作废" <c:if test="${!orders.showBadButton}">disabled="disabled" class="inactive"</c:if>
										onclick="location.href='od_order_update.html?orders.orderId=${orders.orderId}&orders.status=2'" type="button">
								</li>
							</ul> </span> </span>

				</div>
			</div>
			<ul class="btn-bar">
				<li>
					<button type="button" class="btn btn-quit">
						<span><span>关 闭</span> </span>
					</button>
				</li>
			</ul>
		</div>
		<div class="spage-sidebar-wrap">
			<div id="single-page-sidebar">
				<div class="spage-side-nav">
					<ul>
						<li class="cur" onclick="changeNav(this,'order_basic')">
							<span>基本信息</span>
						</li>
						<li class="l-handle" onclick="changeNav(this,'order_pay')">
							<span>收退款记录</span>
						</li>
						<li class="l-handle" onclick="changeNav(this,'order_delivery')">
							<span>收发货记录</span>
						</li>
						<li class="l-handle" onclick="changeNav(this,'order_pmt')">
							<span>优惠方案</span>
						</li>
						<li class="l-handle" onclick="changeNav(this, 'order_log')">
							<span>订单日志</span>
						</li>
					</ul>
				</div>
			</div>
		</div>

		<div class="mainwrap" id="main">
			<div class="spage-main-box" id="order_basic">
				<h3>
					基本信息
				</h3>
				<table width="100%" cellspacing="0" cellpadding="0" border="0">
					<tbody>
						<tr>
							<td style="vertical-align: top;">
								<div>
									<div class="division">
										<div class="table-grid">
											<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gridlist">
												<thead>
													<th>
														货号
													</th>
													<th colspan="2">
														商品名称
													</th> 
													<th>
														价格
													</th>
													<th>
														购买量
													</th>
													<th>
														已发货量
													</th>
												</thead>
												<c:forEach items="${orderItems}" var="item">
													<tr>
														<td>
															${item.bn}
														</td>
														<td colspan="2" class="textleft">
															<a target="_blank" href="">${item.name }</a> 
														</td> 
														<td class="Colamount">
															${item.singlePrice}
														</td>
														<td class="Colamount">
															${item.productCount}
														</td>
														<td class="Colamount">
															${item.sendCount}
														</td>
													</tr>
												</c:forEach>
											</table>
										</div>
									</div>
								</div>
								<div class="tableform">
									<table cellspacing="0" cellpadding="0" border="0" style="width: auto;" class="orderdetails_basic">
										<tbody>
											<tr>
												<td style="vertical-align: top;">
													<h5>
														商品价格
													</h5>
													<div class="division">
														<table cellspacing="0" cellpadding="0" border="0">
															<tbody>
																<tr>
																	<th style="width: 80px;">
																		商品总额：
																	</th>
																	<td>
																		<fmt:message key="common_currency" />${orders.costItem}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		配送费用：
																	</th>
																	<td>
																		<fmt:message key="common_currency" />${orders.costFreight}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		税金：
																	</th>
																	<td>
																		<fmt:message key="common_currency" /> ${orders.costTax}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		订单总额：
																	</th>
																	<td style="font-size: 16px; color: rgb(255, 153, 0); font-weight: 700;">
																		<fmt:message key="common_currency" />${orders.totalAmount}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		已支付金额：
																	</th>
																	<td>
																		<fmt:message key="common_currency" /> ${orders.payed}
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
												<td style="vertical-align: top;">
													<h5>
														订单其他信息
													</h5>
													<div class="division">
														<table cellspacing="0" cellpadding="0" border="0">
															<tbody>
																<tr>
																	<th style="width: 80px;">
																		配送方式：
																	</th>
																	<td>
																		${orders.shipping}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		配送保价：
																	</th>
																	<td>
																		<c:if test="${!orders.protectOn}">否</c:if>
																		<c:if test="${orders.protectOn}">是</c:if>
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		商品重量：
																	</th>
																	<td>
																		${orders.weight}g
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		支付方式：
																	</th>
																	<td>
																		${orders.paymentTypeId}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		是否开票：
																	</th>
																	<td> 
																		<c:if test="${!orders.taxOn}">否</c:if>
																		<c:if test="${orders.taxOn}">是</c:if>
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		发票抬头：
																	</th>
																	<td>
																		<c:if test="${orders.taxOn}">${orders.taxCompany}</c:if>
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		可得积分：
																	</th>
																	<td>
																		${orders.payed}
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
												<td style="vertical-align: top;">
													<h5>
														购买人信息
													</h5>
													<div class="division">
														<table cellspacing="0" cellpadding="0" border="0">
															<tbody>
																<tr>
																	<th style="width: 80px;">
																		用户名：
																	</th>
																	<td>
																		<a target="_blank" href="mb_member_edit.html?memberId=${orders.memberId}"> ${members.uname} </a>
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		姓名：
																	</th>
																	<td>
																		${members.name}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		电话/移动电话：
																	</th>
																	<td>
																		${members.tel}/${members.mobile }
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		地区：
																	</th>
																	<td>
																		${members.province }-${members.city}-${members.area}
																	</td>
																</tr>
																<!-- <tr> <td>省份：</td><td> </td></tr> <tr> <td>邮编：</td><td> </td></tr> -->
																<!--<tr> <th style="width:80px;" >地址：</th> <td>1</td> </tr>-->
																<tr>
																	<th style="width: 80px;">
																		Email：
																	</th>
																	<td>
																		<a href="mailto:${members.email }" target="_self"> ${members.email } </a>
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		QQ:
																	</th>
																	<td>
																		<a target="_self" href="tencent://message/?uin=20849090&amp;&amp;Site=www.shopex.cn&amp;&amp;Menu=yes"><img src="http://wpa.qq.com/pa?p=1:20849090:1" title="20849090" border="0" />
																		</a>
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		MSN:
																	</th>
																	<td>
																		<a href="msnim:chat?contact=23456@aa.com" target="_self"><img width="30" height="30" border="0" title="23456@aa.com"
																				src="http://im.live.com/Messenger/IM/Images/Icons/Messenger.Logo.gif">
																		</a>
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
												<td style="vertical-align: top;">
													<h5 colspan="2">
														收货人信息
													</h5>
													<div class="division">
														<table cellspacing="0" cellpadding="0" border="0">
															<tbody>
																<tr>
																	<th style="width: 80px;">
																		发货日期：
																	</th>
																	<td>
																		${orders.shipTime }
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		姓名：
																	</th>
																	<td>
																		${orders.shipName }
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		电话：
																	</th>
																	<td>
																		${orders.shipTel}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		手机：
																	</th>
																	<td>
																		${orders.shipMobile}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		地区：
																	</th>
																	<td>
																		${orders.shipArea}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		地址：
																	</th>
																	<td style="white-space: normal; line-height: 18px;">
																		${orders.shipAddr}
																	</td>
																</tr>
																<tr>
																	<th style="width: 80px;">
																		邮编：
																	</th>
																	<td>
																		${orders.shipZip}
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<div class="division">
									<div class="table-grid">
										<table width="100%" cellspacing="0" cellpadding="0" border="0">
											<tbody>
												<tr>
													<td style="text-align: left;">
														<strong>会员备注：</strong>${members.remark }
													</td>
												</tr>
												<tr>
													<td style="text-align: left;">
														<strong>订单附言：</strong>${orders.description }
													</td>
												</tr>
											</tbody>
										</table>
									</div>
								</div>
							</td>
						</tr>
					</tbody>
				</table>

				<h3>
					订单备注
				</h3>
				<div id="">

					<input type="hidden" value="${orders.orderId}" name="orders.orderId" id="orders_orderId" />
					<div class="division">
						<table width="100%" cellspacing="0" cellpadding="0" border="0">
							<tbody>
								<tr>
									<th align="right">
										标记：
									</th>
									<td align="left">
										<select style="width: 80px;" name="orders.markType" id="orders_markType">
											<option value="b1">
												b1
											</option>
											<option value="b2">
												b2
											</option>
											<option value="b3">
												b3
											</option>
											<option value="b4">
												b4
											</option>
											<option value="b5">
												b5
											</option>
										</select>

									</td>
								</tr>
								<tr>
									<th>
										订单备注:
									</th>
									<td>
										<textarea style="width: 80%;" rows="6" id="orders_markText" name="orders.markText">${orders.markText }</textarea>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<table cellspacing="0" cellpadding="0" border="0" align="center" class="table-action">
						<tbody>
							<tr>
								<td>
									<button class="btn" onclick=
	updateMark();;
type="button">
										<span><span>保存</span> </span>
									</button>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>

			<div class="spage-main-box" style="display: none;" id="order_pay">
				<h3>
					收退款记录
				</h3>
				<table width="100%" cellspacing="0" cellpadding="0" border="0">
					<tbody>
						<tr>
							<td style="vertical-align: top;">
								<div class="tableform">
									<h4>
										收款单据列表
									</h4>
									<div class="division">
										<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gridlist">

											<thead>
												<tr>
													<th>
														单据日期
													</th>
													<th>
														支付金额
													</th>
													<th>
														支付方式
													</th>
													<th>
														状态
													</th>
												</tr>
											</thead>
											<tbody>
												<c:forEach var="pay" items="${orderPaymentses}" varStatus="index">
													<tr>
														<td>
															${pay.beginString}
														</td>
														<td class="Colamount">
															${pay.money}
														</td>
														<td>
															${pay.paymentName}
														</td>
														<td>
															${pay.status}
														</td>
													</tr>
												</c:forEach>
											</tbody>
										</table>
									</div>
								</div>
							</td>
							<td style="vertical-align: top;">
								<div class="tableform">
									<h4>
										退款单据列表
									</h4>
									<div class="division">
										<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gridlist">
											<col class="Coldate" />
											<col class="Colamount" />
											<thead>
												<tr>
													<th>
														单据日期
													</th>
													<th>
														退款金额
													</th>
													<th>
														退款方式
													</th>
													<th>
														状态
													</th>
												</tr>
											</thead>
											<tbody>
												<c:forEach var="refund" items="${orderRefundses}" varStatus="index">
													<tr>
														<td>
															${refund.readyTimeString}
														</td>
														<td class="Colamount">
															${refund.money }
														</td>
														<td>
															${refund.paymentTypeName}
														</td>
														<td>
															${refund.status}
														</td>
													</tr>
												</c:forEach>
											</tbody>
										</table>
									</div>
								</div>
							</td>
						</tr>
					</tbody>
				</table>


			</div>
			<div class="spage-main-box" style="display: none;" id="order_delivery">
				<h3>
					收发货记录
				</h3>
				<div class="tableform">
					<table width="100%" cellspacing="10" cellpadding="0" border="0">
						<tbody>
							<tr>
								<td style="vertical-align: top;">
									<h4>
										发货单据列表
									</h4>
									<div class="division">
										<table cellspacing="0" cellpadding="0" border="0" class="gridlist">
											<thead>
												<tr>
													<th>
														建立日期
													</th>
													<th>
														发货单号
													</th>
													<th>
														物流单号
													</th>
													<th>
														收件人
													</th>
													<th>
														配送方式
													</th>
												</tr>
											</thead>
											<tbody>
												<c:forEach var="delivery" items="${orderDeliveries}" varStatus="index">
													<tr>
														<td>
															${delivery.deliveryBeginString }
														</td>
														<td>
															${delivery.deliveryId}
														</td>
														<td>
															${delivery.logisticsNo}
														</td>
														<td>
															${delivery.shipName}
														</td>
														<td>
															${delivery.logisticsNo}
														</td>
													</tr>
												</c:forEach>
											</tbody>
										</table>
									</div>
								</td>
								<td style="vertical-align: top;">
									<h4>
										退货单据列表
									</h4>
									<div class="division">
										<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gridlist">
											<col class="Coldate">
												<thead>
													<tr>
														<th>
															建立日期
														</th>
														<th>
															退货单号
														</th>
														<th>
															物流单号
														</th>
														<th>
															退货人
														</th>
														<th>
															配送方式
														</th>
													</tr>
												</thead>
												<tbody>
													<c:forEach var="return" items="${orderDeliveryReturns}" varStatus="index">
														<tr>
															<td>
																${return.deliveryBeginString }
															</td>
															<td>
																${return.deliveryId}
															</td>
															<td>
																${return.logisticsNo}
															</td>
															<td>
																${return.shipName}
															</td>
															<td>
																${return.logisticsNo}
															</td>
														</tr>
													</c:forEach>
												</tbody>
										</table>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="spage-main-box" style="display: none;" id="order_pmt">
				<h3>
					优惠方案
				</h3>
				<div class="division">
					<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gridlist">
						<!--<col class="Collongname"></col>-->
						<col class="Coldetails">
							<col class="Colamount">
								<thead>
									<tr>
										<th>
											优惠方案
										</th>
										<th>
											优惠金额
										</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="pmt" items="${orderPromotionItems}" varStatus="index">
										<tr>
											<td>
												${pmt.pmtDescription }
											</td>
											<td class="Colamount">
												${pmt.pmtAmount }
											</td>
										</tr>
									</c:forEach>
								</tbody>
					</table>
				</div>
			</div>
			<div class="spage-main-box" style="display: none;" id="order_log">
				<h3>
					订单日志
				</h3>
				<div class="tableform">
					<div class="division">
						<div class="table-grid">
							<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gridlist">
								<thead>
									<tr>
										<th>
											序号
										</th>
										<th>
											时间
										</th>
										<th>
											操作人
										</th>
										<th>
											行为
										</th>
										<th>
											结果
										</th>
										<th>
											备注
										</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="log" items="${orderLogs}" varStatus="index">
										<tr>
											<td>
												${log.logId}
											</td>
											<td>
												${log.createTimeString }
											</td>
											<td>
												${log.opName}
											</td>
											<td>
												${log.behavior}
											</td>
											<td>
												${log.result}
											</td>
											<td>
												${log.logText}
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>



		</div>

		<div class="footBar" id="footBar">
		</div>


		<script type="text/javascript" src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
		<%@ include file="/jsp/admin/common/messages.jsp"%>
		<script type="text/javascript">
	function autoHeightAndWeight() {
		$("#main").height($("body").height() - $("#single-page-tbar").height());

	}

	autoHeightAndWeight();

	$('#orders_markType').attr('value', '${orders.markType}');

	function updateMark() {
		var url = "od_order_json_save.html";

		var params = {
			"orders.orderId" : $('#orders_orderId').val(),
			"orders.markType" : $('#orders_markType').val(),
			"orders.markText" : $('#orders_markText').val()
		};

		$.post(url, params, function callback(data) {
			showCallbackResult(data.jsonMessage);

		}, "json");

	}

	function changeNav(obj, id) {
		$("#single-page-sidebar > div  > ul > li").each(
				function(index, domEle) {
					$(domEle).removeClass("cur");
				});
		$(obj).addClass("cur");

		$("#main > div").each(function(index, domEle) {
			$(domEle).css("display", "none");
		});
		$('#' + id).css("display", "");

	}
</script>

	</body>
</html>